/**
  * The component implmenting this interface performs
  * optimization of some cost function through the use
  * of a single-point crossover genetic algorithm.
  */
  
interface GeneticAlgorithm {

	/**
	  * Sets up the genetic algorithm engine.  Configures
	  * the size of the population, the number of generations,
	  * and the probability of a gene mutating.
	  */
	command void initialize_engine (uint8_t _popsize, uint16_t _ngenerations, uint16_t _bitmutation);

	/**
	  * Performs the mating and mutation for the current round
	  * of the genetic algorithm.
	  */
	command void process_generation(uint16_t generationid);

	/**
	  * Prints statistics related to the current round of the
	  * genetic algorithm.  Must be called multiple times to
	  * print the entire statistics set due to tasking limitations
	  * on the micaz platform.
	  */
	command	void report_statistics(uint16_t generationid, uint8_t reportstep);

	/**
	  * Prepares the engine for the next round of the GA.
	  */
	command	void prepare_next_generation();

	/**
	  * Update the component with the fitness value for this particular gene.
	  */
	command	void write_t0_fitness(uint8_t idx, uint16_t value);

	/**
	  * Retrieve the chromosome for a particular member of population a.
	  */
	command	uint16_t read_t0_a_population(uint8_t idx);

	/**
	  * Retrieve the chromosome for a particular member of population b.
	  */
	command	uint16_t read_t0_b_population(uint8_t idx);
}
